/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Progrmas;

/**
 *
 * @author Lab
 */
public class formula {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        int a=1,b=2,c=1;
//Realiza el caculo de la formula general
       double x=(-b +(Math.sqrt(Math.pow(b, 2)-(4*a*c))))/2*a;
        System.out.println("RES"+x);//resultado positivo
       double x2=(-b -(Math.sqrt(Math.pow(b, 2)-(4*a*c))))/2*a;
        System.out.println("RES"+x2);//resultado negativo
    }

}
